<?php
require_once 'Database.php';
/**
 * Created by JetBrains PhpStorm.
 * User: Ernerst Dey
 * Date: 4/14/12
 * Time: 3:06 PM
 */
class Majors extends Database
{
    private $table = 'majors';

    public function save($data) {
        return $this->insert($this->table, $data);
    }

    public function find($arguments=false, $table=null) {
        $this->table = !is_null($table) ? $table : $this->table;
        return parent::find($this->table, $arguments);
    }

    public function majorCategories() {
        return parent::find('major_categories');
    }
	 public function recomendation_group() {
        return parent::find('recomendation_groups');
    }

    public function update($data) {
        if (isset($data['id'])) {
            $id = $data['id'];
            unset($data['id']);
            return parent::update($this->table, $id, $data);
        }
    }

    public function delete($id) {
        if ($id) {
            return parent::delete($id, $this->table);
        }
    }

}


